/**
 * 仿JSON内置API parse方法
 * 
 * @param {String} javaData JSON数据格式
 * @returns Object
 */
function prase(javaData) {
    //let javaData = '{"uname":"元宇宙👁", "price": "18"}'
    let temp = {}
    javaData = javaData.replace(/{|}|"|\s/g, '')
    //console.log(javaData);
    let javaDataArr = javaData.split(',')
    //console.log(javaDataArr);
    javaDataArr.forEach(item => {
        let keyValArr = item.split(':')
        //console.log(temp);
        let key = keyValArr[0]
        let val = keyValArr[1]
        temp[key] = val
    })
    //console.log(temp);
    return temp
}


/**
 * 仿JSON内置API stringify方法
 * @param {Object} webObj JS标准普通对象
 * @returns String
 */
function stringify(webObj) {
    //let webObj = { a: 1, b: 2, c: "你好" }
    let arr = []
    for (let key in webObj) {
        let temp = `"${key}":"${webObj[key]}"`
        //console.log(temp);
        arr.push(temp)
    }
}
//console.log(`{${arr.join(',')}}`);
return `{${arr.join(',')}}`

